﻿// -----------------------------------------------------------------------
// <copyright file="PlayerModel.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Yottamud_2013_v3_Main
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
using System.Runtime.InteropServices;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class Player
    {

        [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
        public struct PlayerRecord
        {
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)]
            public char[] BBSName;          //'1
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
            public char[] FirstName;        // As String * 10            '2
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
            public char[] LastName;
            public int NotExperience;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
            public short[] SpellCasted;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
            public short[] SpellValue;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
            public short[] SpellRoundsLeft;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
            public char[] Title;
            public short Race;
            public short Class;
            public short Level;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
            public short[] Stat;
            public short MaxHP;
            public short CurrentHP;
            public short MaxEnc;
            public short CurrentEnc;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
            public short[] Energy;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
            public short[] Unknown_1; // this should be 125
            public short MagicRes;
            public short MagicRes_2;
            public int MapNumber;
            public int RoomNumber;
            public short Nothing_2;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
            public short[] Unknown_2;
            public short Nothing_3;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
            public byte[] Unknown_3;
            public short Nothing_4;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
            public int[] Item;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
            public short[] ItemUses;
            public int Nothing_5;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
            public int[] Key;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
            public short[] KeyUses;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
            public int[] Unknown_4;
            public int BillionsOfExperience;
            public int MillionsOfExperience;
            public short Nothing_6; // should be 64(hex).
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
            public short[] Spell;
            public short EvilPoints;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
            public int[] Nothing_7;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
            public int[] LastMap;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
            public int[] LastRoom;
            public short Nothing_8;
            public short BroadCastChannel;
            public int Unknown_5; // always 513.
            public short Perception;
            public short Stealth;
            public short MartialArts;
            public short Thievery;
            public short MaxMana;
            public short CurrentMana;
            public short SpellCasting;
            public short Traps;
            public short Unknown_6;
            public short Picklocks;
            public short Tracking;
            public short Nothing_9;
            public int Runic;
            public int Platinum;
            public int Gold;
            public int Silver;
            public int Copper;
            public int WeaponHand;
            public int Nothing_10;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
            public int[] WornItems;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
            public short[] Unknown_7;
            public short Unknown_8;
            public short LivesRemaining;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
            public short[] Unknown_9;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
            public char[] GangName;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
            public byte[] Unknown_11;
            public short CPRemaining;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
            public char[] SuicidePassword;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 39)]
            public short[] Unknown_12;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)]
            public short[] Ability;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)]
            public short[] AbilityModifier;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
            public short[] Unknown_13ag;
            public int CharLife;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
            public short[] Unknown14;
            public byte BitMaskOne;
            public byte BitMaskTwo;
            public byte TestFlagOne;
            public byte TestFlagTwo;
            public short Unknown14a;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
            public int[] Unknown15;
        }
    }
}
